package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.sta.StaBreakPointDto;
import com.ysd.lis.entity.bac.BacBreakPoint;
import com.ysd.lis.request.Params;
import com.ysd.lis.request.bac.BreakPointDto;
import com.ysd.lis.request.bac.BreakPointMapperCategoryParam;
import com.ysd.lis.request.bac.BreakPointParam;
import com.ysd.lis.service.bac.BacBreakPointService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wanghuaixing
 * @since 2024-12-25
 */
@RestController
@RequestMapping("/bac-break-point")
public class BacBreakPointController extends BaseController {

    @Autowired
    BacBreakPointService bacBreakPointService;

    @ApiOperation("获取折点信息")
    @GetMapping("/findBreakPointList")
    public Result findBreakPointList(Params params) {
        return bacBreakPointService.findBreakPointList(params);
    }

    @ApiOperation("根据主键获取折点信息")
    @GetMapping("/findBreakPointOne")
    public Result findBreakPointOne(BreakPointParam params) {
        return bacBreakPointService.findBreakPointOne(params);
    }

    @ApiOperation("添加折点")
    @PostMapping("/addBreakPoint")
    public Result addBreakPoint(@RequestBody BacBreakPoint bacBreakPoint) {
        return bacBreakPointService.addBreakPoint(bacBreakPoint);
    }

    @ApiOperation("修改折点")
    @PostMapping("/updateBreakPoint")
    public Result updateBreakPoint(@RequestBody BacBreakPoint bacBreakPoint) {
        return bacBreakPointService.updateBreakPoint(bacBreakPoint);
    }

    @ApiOperation("批量修改")
    @PostMapping("/batchUpdateBreakPoint")
    public Result batchUpdateBreakPoint(@RequestBody BreakPointDto vo) {
        return bacBreakPointService.batchUpdateBreakPoint(vo);
    }


    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteBreakPoint")
    public Result batchDeleteBreakPoint(@RequestBody BreakPointDto vo) {
        return bacBreakPointService.batchDeleteBreakPoint(vo);
    }

    @ApiOperation("用户自定义折点 分类明细查询")
    @GetMapping("/findCategoryByCode")
    public Result findCategoryByCode(BreakPointMapperCategoryParam input) {
        return bacBreakPointService.findCategoryByCode(input);
    }

    @ApiOperation("用户自定义折点 分类明细-细菌 查询")
    @PostMapping("/findGermDictListByCode")
    public Result findGermDictListByCode(@RequestBody BreakPointMapperCategoryParam input) {
        return bacBreakPointService.findGermDictListByCode(input);
    }

    @ApiOperation("用户自定义折点 分类明细-已维护折点信息 查询")
    @PostMapping("/findBreakPointListByCode")
    public Result findBreakPointListByCode(@RequestBody BreakPointMapperCategoryParam input) {
        return bacBreakPointService.findBreakPointListByCode(input);
    }


    @ApiOperation("获取折点日志")
    @GetMapping("/getPointLogList")
    public Result getPointLogList(Params params) {
        return bacBreakPointService.getPointLogList(params);
    }
}
